//
// Created by wkm on 2023-12-03.
//

#ifndef MYSYSTEMCLEARNING_COUNT4_H
#define MYSYSTEMCLEARNING_COUNT4_H

#include "systemc.h"

const int COUNT_SIZE = 4;

SC_MODULE(count4) {
    sc_in<bool> mclk, clear, updown;
    sc_out<sc_uint<COUNT_SIZE> > data_out;

    void sync_block();

    SC_CTOR(count4) {
        SC_METHOD(sync_block);
        sensitive_pos << mclk; // 时钟来的正跳变沿触发
        sensitive_neg << clear; // 时钟来的负跳变沿触发
    }
};

#endif //MYSYSTEMCLEARNING_COUNT4_H
